home *** CD-ROM | disk | FTP | other *** search
- Path: news.dtd.com!usenet
- From: Neil Radisch <nradisch@dtd.com>
- Newsgroups: comp.lang.c++
- Subject: Re: On Exception handling.....from a newbie
- Date: Fri, 19 Jan 1996 08:04:16 -0500
- Organization: Downtown Ditial
- Message-ID: <30FF96D0.6BC7@dtd.com>
- References: <1996Jan15.013336.4730@sfov1.verifone.com> <4ddpjh$3au@dawn.mmm.com>
- NNTP-Posting-Host: sungod.dtd.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (X11; I; SunOS 5.3 sun4m)
-
- That's legal??!!??
-
-
- >
- > How about this?
- > bool retry = true;
- > while (retry) {
- > AutoFileCloser autoCloser;
- > try {
- > open file;
- > autoCloser.manage(something); // give "handle" to autoCloser
- > read the blocks;
- > retry = false;
- > } catch (OpenFileException e) {
- > } catch (ReadFileException e) {
- > }
- > // autoCloser closes file here, if necessary
- > }
- >
-